1. Field of the Invention
The present invention is directed to a system that composes color transforms as needed and, more particularly, to a system where the accuracy of a composed transform is improved by automatically selecting the input and output transforms of the composed transform, based on the classes of the transforms in the sequence to be composed.
2. Description of the Related Art
Complex mathematical functions, such as color transform functions, are often represented by tabular functions, which are tables containing function values. Each value in the table is the value of the function for a particular set of input values. The complete table is made by calculating and storing in the table the output values of the function at a uniform sampling over the desired range of input values. The tabular function is evaluated by finding the table entries which are closest to the input values and then interpolating between the tabulated values to produce an approximation to the actual value of the function. FIG. 1 depicts a one-dimensional tabular function y=f(x) where calculated values 12 are stored in the table 10 and an input value (x) selects a table entry 14 which contains the output value (y). FIG. 2 illustrates a three-dimensional tabular function t=f(x,y,z) where calculated values are stored in a table 16 and input values (x,y,z) select a table entry 18 which is the output value (t).
This method of evaluating complex functions has several advantages in a computer system. It can represent complex functions very compactly, the functions can be evaluated very quickly, and two tabular functions can be combined (or composed) into a single tabular function.
The method has the disadvantage of reduced accuracy, which are caused by a number of factors collectively referred to as interpolation error. Several techniques have been developed to reduce interpolation error, such as increasing the number of tabular function values and using different interpolation methods. Another common method is to construct the tabular function as a series of tabular functions which are evaluated in a specific sequence to produce the overall, or net, function value.
One particular method, commonly used for color transformation functions, combines a set of nine tabular functions into a grouped tabular function (GTF) as depicted in FIG. 3. It could be used, for example, for the conversion between the RGB for a scanner and RGB for a monitor, which requires three functions, each of which is a function of the same three inputs: f1(r, g, b)=r', f2(r, g, b)=g', and f3(r, g, b)=b'.
The first three tabular functions form a set of one dimensional tables in which there is one tabular function for each input value (x'=f1(x), y'=f2(y), z'=f3(z)). These are the "input" tables 32, 34 and 36. The second three tabular functions form a set of multi-dimensional tables in which each dimension of a table corresponds to a particular input (u'=f4(x',y',z'), v'=f5(x',y',z'), w'=f6(x',y',z')). These are the "grid" or "lattice" tables 38, 40 and 42. The last three tabular functions form a set of one dimensional tables which produce the actual function values (u=f7(u'), v=f8(v'), w=f9(w')). These are the "output" tables 44, 46 and 48. This is the input tables (I), lattice tables (L), and output tables (O) or ILO form of a GTF 52 as depicted in FIG. 4. Judicious partitioning of the mathematical functions being represented by the GTF into the three tabular functions can dramatically reduce the interpolation error of the GTF.
It is common to use two tabular functions sequentially and is therefore useful to combine the two tabular functions into a single net tabular function using functional composition. The net tabular function uses the input value of the first tabular function and produces output function values of the second tabular function.
A sequence of two GTFs 62 and 64 in the ILO form, that is, GTF1 followed by GTF2 as depicted in FIG. 5, is typically composed into a net GTF 66 as follows:
1) form the net GTF with the same input and lattice table sizes as GTF1 and the output table sizes of GTF2. PA1 2) copy the input table entries of GTF1 into the net GTF input table entries. PA1 3) copy the output table entries of GTF2 into the net GTF output table entries. PA1 4) calculate the net GTF lattice tables:
for each lattice table position m PA2 for each net GTF lattice table n apply the set of input values to GTF2 lattice table n to get LTVALUE
for each GTF1 lattice table n PA3 get the GTF1 lattice table value LTVALUE at position m PA3 apply LTVALUE to GTF1 output table n to get OTVALUE PA3 apply OTVALUE to GTF2 input table n to get OIVALUE PA3 store OIVALUE in position n of the set of input values PA3 store LTVALUE into net GTF lattice table n at position m
The net GTF has: 1) input tables which are the same as the input tables of GTF1, 2) output tables which are the same as GTF2, and 3) lattice tables which are the combination of the lattice tables of GTF 1, the output tables of GTF 1, the input tables of GTF2, and the lattice tables of GTF2.
However, this partitioning of the net GTF into its constituent tabular functions may not be optimal for the mathematical function that it represents, i.e. the input tables of GTF1 and the output tables of GTF2 may not be the most judicious selection of input and output functions for the net function.
One method of reducing interpolation error is to add pre-existing and previously created prefix and suffix identity GTFs to the beginning and end of the sequence of GTFs and create a net GTF from the prefix, sequence GTF(s) and suffix GTF. The pre-existing identity GTFs are designed for known or pre-existing sequence GTFs and various known combinations thereof. When the previously described method of functional composition is used, this results in a net GTF which has the input tables of the prefix GTF and the output tables of the suffix GTF. If the input and output tables are appropriate for the net GTF, the interpolation error of the net GTF will be reduced. The identity GTFs are constructed such that each of their functions corresponds to f(x)=x. This is typically done by filling the input tables with the values of the desired input functions, filling the lattice table entries with an identity function, and filling the output tables with the inverse of the function in the input tables.
For this method to work properly, the prefix and suffix GTFs must be selected carefully, because an improper choice could easily result in greater interpolation error. One method of selecting the prefix and suffix GTFs is to associate information about the GTFs with the GTFs, in particular information which identifies the specific nature, or type, of the input values for the GTFs and the specific nature, or type, of the output from the GTFs. The specific knowledge of the particular types of the input values (for example, scanner, camera, etc.) and output values (for example, to a paper printer, photo printer, etc.) allows the determination of appropriate functions for the input and output tables of the net GTF. A table 70 as depicted in FIG. 6 is constructed which lists the specific prefix and suffix GTFs to use for each combination of types. As shown in FIG. 6, a particular combination may require using both prefix and suffix GTFs, or neither prefix nor suffix GTF. During operation of this method, the prefix and suffix GTFs discussed above are created ahead of time and stored. At the time a GTF is created, the builder determines, using his experience and knowledge about the color device which provides the input image or receives the output image, which types should be associated with the GTF by reviewing the table of available types. The appropriate types are stored with the GTF. When the GTF is later used as part of a sequence of GTFs being composed, the types are used to select the prefix and/or suffix GTFs from the table. The prefix/suffix GTF is then composed with the sequence GTFs (GTF1 and GTF2).
In this method, both prefix, suffix, and sequence GTFs are known as well as their possible combinations, which enables making and creating a good net GTF a matter of picking the proper prefix and suffix GTFs. This method will reduce the interpolation error of the net GTF, but it has the disadvantage of requiring that the specific information about the particular input and output types of the GTF be stored with the GTF. This means it sometimes is not possible to determine the appropriate entry in the table (see entry 1--1 of FIG. 6). In the case of GTFs in International Color Consortium (ICC) profiles, it is a major disadvantage because this information is not part of the public information of the ICC profile. The method is also highly tuned to specific cases and thus suffers from a lack of generality.
What is needed is an improved method of determining the input and output functions to be used in the net GTF. This enables the composition of sequence GTFs which do not have type information such that the interpolation error of the net GTF is reduced.